package com.onesports.intelligent.k12.polarlight.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import com.onesports.framework.kit.common.util.ParamUtils;

/**
 * 消息类型
 * @author wangcx
 **/
public enum MessageTypeEnum implements IEnum<String> {
    /**
     * 消息类型
     */
    CAMPUS_APPLY("1","申报新社区"),
    COACH_APPLY("2","申报成为教练"),
    STUDENT_NO_ENOUGH("3","学员课款不足"),
    CLASS_DISSOLVED_DUE_DATE("4","班级解散：到期结课"),
    CLASS_DISSOLVED_GIRTH("5","班级解散：团长解散"),
    CLASS_DISSOLVED_NO_ENOUGH("6","班级解散：人数不足"),
    COURSE_REMIND("7","上课提醒"),
    AUTO_PAY_REMIND("8","自动扣款通知"),
    NO_ENOUGH_MONEY("9","通知人数不足以开课"),
    NO_ENOUGH_PEOPLE("10","人数不足，开班失败"),
    RECEIVER_TYPE_OP("1","接受类型：运营人员"),
    RECEIVER_TYPE_ORG("2","接受类型：机构人员"),
    RECEIVER_TYPE_OTHER("3","接受类型：其他人员");





    private final String type;
    private final String desc;


    MessageTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return this.type;
    }

    @JsonValue
    public String getDesc() {
        return this.desc;
    }

    public MessageTypeEnum of() {
        return this;
    }

    public static MessageTypeEnum of(String desc) {
        for (MessageTypeEnum opt : MessageTypeEnum.values()) {
            if (ParamUtils.equals(opt.desc, desc)) {
                return opt;
            }
        }
        return null;
    }
}
